<template>
  <div>
    <h1>商品销售</h1>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="statisticsId" label="统计编号" width="180"></el-table-column>
      <el-table-column prop="storeId" label="商家编号" width="180"></el-table-column>
      <el-table-column prop="goodsId" label="商品编号" width="180"></el-table-column>
      <el-table-column prop="createTime" label="创建时间" width="180"></el-table-column>
      <el-table-column prop="updateTime" label="最后修改时间" width="180"></el-table-column>
<!--      <el-table-column prop="deleted" label="日期" width="180"></el-table-column>-->
    </el-table>
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="sVo.page"
        :page-sizes="[1, 3, 6, 9]"
        :page-size="sVo.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="sVo.total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
  import axios from "axios";

  export default {
    name: 'Index',
    data(){
      return{
        tableData:[],
        sVo:{page:1,size:3,total:0}
      }
    },
    methods:{
      getlist(){
        var us= new FormData();
        us.append("page",this.sVo.page)
        us.append("size",this.sVo.size)
        us.append("total",this.sVo.total)
        axios.post("http://localhost:7000/shop/satis/statisticslist",this.sVo,us).then(res=>{
          console.log(res)
          this.sVo.total=res.data.data.total
          this.tableData=res.data.data.records
        })
      },
      handleSizeChange(val) {
        this.sVo.size=val
        console.log(`每页 ${val} 条`);
        this.getlist()
      },
      handleCurrentChange(val) {
        this.sVo.page=val
        console.log(`当前页: ${val}`);
        this.getlist()
      }
    },
    mounted() {
      this.getlist()
    }
  }
</script>

<style scoped></style>
